/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package AccesoDatos.Persistencia.Entidad;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author sebaxtian
 */
@Entity
@Table(name = "PRESTAMO")
@NamedQueries({
    @NamedQuery(name = "EPrestamo.findAll", query = "SELECT e FROM EPrestamo e"),
    @NamedQuery(name = "EPrestamo.findByIdprestamo", query = "SELECT e FROM EPrestamo e WHERE e.idprestamo = :idprestamo"),
    @NamedQuery(name = "EPrestamo.findByCedulaempleado", query = "SELECT e FROM EPrestamo e WHERE e.cedulaempleado = :cedulaempleado"),
    @NamedQuery(name = "EPrestamo.findByIdorden", query = "SELECT e FROM EPrestamo e WHERE e.idorden = :idorden"),
    @NamedQuery(name = "EPrestamo.findByFechaentrega", query = "SELECT e FROM EPrestamo e WHERE e.fechaentrega = :fechaentrega"),
    @NamedQuery(name = "EPrestamo.findByDevuelto", query = "SELECT e FROM EPrestamo e WHERE e.devuelto = :devuelto")})
public class EPrestamo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IDPRESTAMO")
    private Integer idprestamo;
    @Basic(optional = false)
    @Column(name = "CEDULAEMPLEADO")
    private int cedulaempleado;
    @Basic(optional = false)
    @Column(name = "IDORDEN")
    private int idorden;
    @Basic(optional = false)
    @Column(name = "FECHAENTREGA")
    @Temporal(TemporalType.DATE)
    private Date fechaentrega;
    @Basic(optional = false)
    @Column(name = "DEVUELTO")
    private boolean devuelto;

    public EPrestamo() {
    }

    public EPrestamo(Integer idprestamo) {
        this.idprestamo = idprestamo;
    }

    public EPrestamo(Integer idprestamo, int cedulaempleado, int idorden, Date fechaentrega, boolean devuelto) {
        this.idprestamo = idprestamo;
        this.cedulaempleado = cedulaempleado;
        this.idorden = idorden;
        this.fechaentrega = fechaentrega;
        this.devuelto = devuelto;
    }

    public Integer getIdprestamo() {
        return idprestamo;
    }

    public void setIdprestamo(Integer idprestamo) {
        this.idprestamo = idprestamo;
    }

    public int getCedulaempleado() {
        return cedulaempleado;
    }

    public void setCedulaempleado(int cedulaempleado) {
        this.cedulaempleado = cedulaempleado;
    }

    public int getIdorden() {
        return idorden;
    }

    public void setIdorden(int idorden) {
        this.idorden = idorden;
    }

    public Date getFechaentrega() {
        return fechaentrega;
    }

    public void setFechaentrega(Date fechaentrega) {
        this.fechaentrega = fechaentrega;
    }

    public boolean getDevuelto() {
        return devuelto;
    }

    public void setDevuelto(boolean devuelto) {
        this.devuelto = devuelto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idprestamo != null ? idprestamo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EPrestamo)) {
            return false;
        }
        EPrestamo other = (EPrestamo) object;
        if ((this.idprestamo == null && other.idprestamo != null) || (this.idprestamo != null && !this.idprestamo.equals(other.idprestamo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "AccesoDatos.Persistencia.Entidad.EPrestamo[idprestamo=" + idprestamo + "]";
    }

}
